package edu.sctu.xiangkun.day201505.day20150506;

/**
 * Created by user21 on 2015/5/6.
 */
public class RoundDemo {
    public void demo(){
        double x = 12.56;
        double num1 = Math.rint(25.12);
        double num2 = Math.ceil(25.12);
        double num3 = Math.floor(25.12);

        System.out.println("Math.round("+x+")="+Math.round(x));
        System.out.println("Math.rint(25.12)="+num1);
        System.out.println("Math.ceil(25.12)="+num2);
        System.out.println("Math.floor(25.12)="+num3);
    }
    public static void main(String[] args){
        RoundDemo rounddemo = new RoundDemo();
        rounddemo.demo();

        new RoundDemo();
    }
}
